package objects;

import sections.ISection.Section;

public class File implements IObject
{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1483207311342107777L;

	private String fIdentifier;
	private String fBaseObject;
	private String fAlias;
	private String fFilename;
	private String fFormat;
	private String fSize;
	private String fStore;
	private String fLocation;
	private String fTable;
	private String fOID;

	public File(String identifier)
	{
		fIdentifier = identifier;

		fBaseObject = "";
		fAlias = "";
		fFilename = "";
		fFormat = "";
		fSize = "";
		fStore = "";
		fLocation = "";
		fTable = "";
		fOID = "";
	}

	@Override
	public String getObjectName()
	{
		return fIdentifier;
	}

	@Override
	public Section getSectionType()
	{
		return Section.FILE;
	}

	public String getIdentifier()
	{
		return fIdentifier;
	}

	public void setIdentifier(String identifier)
	{
		this.fIdentifier = identifier;
	}

	public String getBaseObject()
	{
		return fBaseObject;
	}

	public void setBaseObject(String baseObject)
	{
		this.fBaseObject = baseObject;
	}

	public String getAlias()
	{
		return fAlias;
	}

	public void setAlias(String alias)
	{
		this.fAlias = alias;
	}

	public String getFilename()
	{
		return fFilename;
	}

	public void setFilename(String filename)
	{
		this.fFilename = filename;
	}

	public String getFormat()
	{
		return fFormat;
	}

	public void setFormat(String format)
	{
		this.fFormat = format;
	}

	public String getSize()
	{
		return fSize;
	}

	public void setSize(String size)
	{
		this.fSize = size;
	}

	public String getStore()
	{
		return fStore;
	}

	public void setStore(String store)
	{
		this.fStore = store;
	}

	public String getLocation()
	{
		return fLocation;
	}

	public void setLocation(String location)
	{
		this.fLocation = location;
	}

	public String getTable()
	{
		return fTable;
	}

	public void setTable(String table)
	{
		this.fTable = table;
	}
	
	public String getOID()
	{
		return fOID;
	}

	public void setOID(String oid)
	{
		this.fOID = oid;
	}
	
	
	@Override
	public String toString()
	{
		StringBuffer fileString = new StringBuffer(300);
		
		fileString.append("file \"");
		fileString.append(fIdentifier);
		fileString.append("\" {");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tbaseobject \"");
		fileString.append(fBaseObject);
		fileString.append("\" in ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fOID);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\talias ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fAlias);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tfilename ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fFilename);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tformat ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fFormat);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tsize ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fSize);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tstore ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fStore);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		fileString.append("\tlocation ");
		fileString.append(fTable);
		fileString.append("(");
		fileString.append(fLocation);
		fileString.append(");");
		fileString.append(AdapletConstants.sNewLine);
		
		return fileString.toString();
	}

}
